﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Warranty.Model.Interface;
using Warranty.Model.Model;
using Common.Util;

namespace Warranty.Provider
{
    public class OrderShipHistProvider : GenericProvider, IOrderShipHistProvider
    {
        public List< OrderShipHist> SearchOrderShipHist(string InvoiceNumber = "", string ShiptoCode = "")
        {
            var query = repository.GetQuery<OrderShipHist>();
            if (!InvoiceNumber.IsNullOrWhiteSpace())
                query = query.Where(x => x.InvoiceNo.ToUpper() == InvoiceNumber.ToUpper());

            if (!ShiptoCode.IsNullOrWhiteSpace())
                query = query.Where(x => x.ShiptoCode.ToUpper() == ShiptoCode.ToUpper());
            return query.ToList();
        }
    }
}
